package com.zzx.schoolfellow.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzx.schoolfellow.model.entity.UmsUser;
import io.lettuce.core.dynamic.annotation.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UmsUserMapper extends BaseMapper<UmsUser> {

    @Select("SELECT u.* FROM ums_user u JOIN bms_follow f ON u.id = f.follower_id WHERE f.parent_id = #{userId}")
    List<UmsUser> selectFollowers(@Param("userId") String userId);
    // 查询用户列表
    @Select("select * from ums_user")
    List<UmsUser> selectUserList();
}